package com.celan.year2023.month06.day04;

import java.util.Arrays;
import java.util.HashSet;

/**
 * @author Celan
 * @description TODO
 */
public class Solution {
    public int distinctAverages(int[] nums) {
        int n = nums.length;
        Arrays.sort(nums);
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < n / 2; i++) {
            set.add(nums[i] + nums[n - i - 1]);
        }
        return set.size();
    }
}
